// 定义数组类型
let arr1: number[] = [1, 2, 3, 4, 5]
let arr2: Array<number> = [1, 2, 3, 4, 5]

// 定义元组类型
let tuple: [string, string, number] = ["abc", "M", 12]


/*let obj1 = {
    "name" :"abcque",
    "gender":"M",
    "age":18
}

console.log(obj1);

let name = "abcque"
let gender = "M"
let age = 18

let obj2 = {
    "name":name,
    "gender":gender,
    "age":age
}

console.log(obj2);

let obj3  = {
    name,
    gender,
    age
}

console.log(obj3)*/

// 注解中的个数和类型要求和实际的都要匹配
// 顺序不做要求,通常按照定义顺序来写
let obj1: {name: string, gender: string, age: number } = {
    "age": 18,
    "name": "abcque",
    "gender": "M",
}

console.log(obj1);


let id = "abcque"
let gender = "M"
let age = 18

let obj2:{id: string, gender: string, age: number } = {
    id,
    gender,
    age
}

console.log(obj2);